using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerAnim : MonoBehaviour
{
    public Animator[] animators;    //0 up 1 down

    public void PlayIdleAnim()
    {
        foreach (var a in animators)
        {
            a.SetBool("walk", false);
        }
        animators[0].SetBool("shoot", false);
        animators[0].SetBool("shootup", false);

    }

    public void PlayWalkAnim()
    {
        foreach (var a in animators)
        {
            a.SetBool("walk", true);
        }
    }

    public void PlayJumpAnim()
    {
        foreach(var a in animators)
        {
            a.SetTrigger("jump");
        }
    }

    public void PlayAttackAnim()
    {
        animators[0].SetTrigger("attack");
    }

    public void PlayThrowAnim() 
    {
        animators[0].SetTrigger("throw");
    }

    public void PlayShootAnim()
    {
        animators[0].SetBool("shoot", true);
    }

    public void PlayShootupAnim()
    {
        animators[0].SetBool("shootup", true);
    }

    public void PlayDieAnim()
    {
        animators[0].gameObject.SetActive(false);
        animators[1].SetTrigger("die");
        //TO-DO delete player
    }

    public void PlayResumeAnim()
    {
        animators[0].gameObject.SetActive(true);
        animators[1].gameObject.SetActive(true);
        animators[1].SetTrigger("idle");
    }
}
